/*!
 * 字典管理 通用（请求）方法
 *  
 * 作者：张莉
 * Copyright (c) 2019/12/04
 * 
 */

/**
 * @method dictSearch 字典搜索接口
 * @param {object} params 存放搜索树节点的名称dictName对象
 * @return axios
 */
export const dictSearch = (params) => {
  return axios.post('/base/dict/dictSearch', params)
}
/**
 * @method dictDel 字典删除接口 
 * @param {string} id 是字典节点的dictId
 * @return axios
 */
export const dictDel = (id) => {
  return axios.delete(`/base/dict/delDict/${id}`)
}
/**
 * @method allRootDict 字典树父级接口
 * @return axios
 */
export const allRootDict = () => {
  return axios.get('/base/dict/allRootDict')
}
/** 
 * @method children 字典树子级接口
 * @param {string} id 是当前树父节点dictId
 * @return axios
 */
export const children = (id) => {
  return axios.get(`/base/dict/children/${id}`)
}
/**
 * @method eosDictDetails 点击字典树查看详情接口
 * @param {string} id 是点击当前数树节点的dictId
 * @return axios
 */
export const eosDictDetails = (id) => {
  return axios.get(`/base/dict/${id}`)
}
/**
 * @method eosDictSvOrUp 字典保存接口
 * @param {object} data 存放树节点dictId,数上级节点类型dictTypeId,树节点名称dictName,排序号sortNo,是否禁用enableFlag
 * @return axios
 */
export const eosDictSvOrUp = (data) => {
  return axios({
    url: '/base/dict/svOrUp',
    method: 'post',
    data
  })
}
/**
 * @method eosDictNext 字典新增接口
 * @param {object} data 存放树节点dictId,数上级节点类型dictTypeId,树节点名称dictName,排序号sortNo,是否禁用enableFlag
 * @return axios
 */
export const eosDictNext = (data) => {
  return axios({
    url: '/base/dict/next',
    method: 'post',
    data
  })
}